package com.clearance.mine_clearance.untils;

import com.clearance.mine_clearance.entry.RedPacket;

public class MinesUntils {

    public static Integer getRedPacket(RedPacket redPacket){
        Integer diceValue = redPacket.getDiceValue();
        Integer mines = redPacket.getMines();
        if((diceValue+mines)>=10){
            String minesString = String.valueOf(mines);
            return Integer.valueOf(minesString.substring(minesString.length() - 1));

        }else {
            return mines;
        }
    }
}
